package com.rpay.common.enums;

/**
 * Title：
 * Description
 *
 * @author fxg06 on 2018/5/15
 * @version 1.0
 */
public enum  LevelEnum {
    ONE(1, 3),
    TWO(2, 6),
    THREE(3, 9),
    FOUR(4, 12),
    FIVE(5, 15),
    SIX(6, 15);

    private Integer level;
    private Integer generation;

    LevelEnum(Integer level, Integer generation) {
       this.level = level;
       this.generation = generation;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Integer getGeneration() {
        return generation;
    }

    public void setGeneration(Integer generation) {
        this.generation = generation;
    }

    public static Integer getGenerateion(Integer level) {
        for (LevelEnum levelEnum : LevelEnum.values()) {
            if (levelEnum.getLevel().equals(level)) {
                return levelEnum.getGeneration();
            }
        }
        return 0;
    }
}
